(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.4' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[      9199,        312]
NotebookOptionsPosition[      6230,        221]
NotebookOutlinePosition[      8261,        276]
CellTagsIndexPosition[      8177,        271]
WindowTitle->ExpandAll2
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {Cell["FEYN CALC SYMBOL", "PacletNameCell"], Cell[TextData[Cell[BoxData[
     ActionMenuBox[
      FrameBox[
       InterpretationBox[Cell[TextData[{
         "URL",
         StyleBox[" \[FilledDownTriangle]", "AnchorBarArrow",
          StripOnInput->False]
        }]],
        TextCell[
         Row[{"URL", 
           Style[" \[FilledDownTriangle]", "AnchorBarArrow"]}]]],
       StripOnInput->False], {"\<\"FeynCalc/ref/ExpandAll2\"\>":>
      None, "\<\"Copy Wolfram Documentation Center URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell["FeynCalc/ref/ExpandAll2"]}, Visible -> False]]; 
       SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; Null], 
      Delimiter, "\<\"Copy web URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell[
             BoxData[
              MakeBoxes[
               Hyperlink[
               "http://reference.wolfram.com/language/FeynCalc/ref/ExpandAll2.\
html"], StandardForm]], "Input", TextClipboardType -> "PlainText"]}, Visible -> 
           False]]; SelectionMove[
        DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; 
       Null], "\<\"Go to web URL\"\>":>FrontEndExecute[{
        NotebookLocate[{
          URL[
           StringJoin[
            If[
             TrueQ[DocumentationBuild`Make`Private`wsmlinkQ$82106], 
             "http://reference.wolfram.com/system-modeler/", 
             "http://reference.wolfram.com/language/"], 
            "FeynCalc/ref/ExpandAll2", ".html"]], None}]}]},
      Appearance->None,
      MenuAppearance->Automatic,
      MenuStyle->"URLMenu"]],
     LineSpacing->{1.4, 0}]], "AnchorBar"]}
  }]], "AnchorBarGrid",
 GridBoxOptions->{GridBoxItemSize->{"Columns" -> {
     Scaled[0.65], {
      Scaled[0.34]}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}}},
 CellID->1],

Cell[TextData[{
 Cell["ExpandAll2", "ObjectName"],
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{8, 0}],
    CacheGraphics->False],
   Spacer[8]]]],
 Cell[BoxData[""], "ObjectNameTranslation"]
}], "ObjectNameGrid"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{"ExpandAll2", "[", "exp", "]"}]], "InlineFormula"],
     " \[LineSeparator]",
     " is similar to ExpandAll, but much faster on simple structures."
    }]]}
  }]], "Usage",
 GridBoxOptions->{
 GridBoxBackground->{
  "Columns" -> {{None}}, "ColumnsIndexed" -> {}, "Rows" -> {{None}}, 
   "RowsIndexed" -> {}}},
 CellID->982511436],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{6, 0}],
    CacheGraphics->False],
   Spacer[6]]]],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CellTags->"PrimaryExamplesSection",
 CellID->2028008185],

Cell[CellGroupData[{

Cell[TextData[{
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CellID->1783834313],

Cell["Benchmark against the standard ExpandAll", "Notes",
 CellID->29146736],

Cell[BoxData[
 RowBox[{
  RowBox[{"exp", "=", 
   RowBox[{
    RowBox[{"Sum", "[", 
     RowBox[{
      RowBox[{"p", "[", "i", "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"i", ",", "1", ",", "100"}], "}"}]}], "]"}], " ", 
    RowBox[{"Sum", "[", 
     RowBox[{
      RowBox[{"q", "[", "i", "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"i", ",", "1", ",", "1000"}], "}"}]}], "]"}]}]}], 
  ";"}]], "Input",
 CellLabel->"In[1]:=",
 CellID->815060274],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"AbsoluteTiming", "[", 
  RowBox[{
   RowBox[{"res1", "=", 
    RowBox[{"ExpandAll", "[", "exp", "]"}]}], ";"}], "]"}]], "Input",
 CellLabel->"In[2]:=",
 CellID->1771988175],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{"0.231287`", ",", "Null"}], "}"}], TraditionalForm]], "Output",
 ImageSize->{105, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[2]=",
 CellID->562912175]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"AbsoluteTiming", "[", 
  RowBox[{
   RowBox[{"res2", "=", 
    RowBox[{"ExpandAll2", "[", "exp", "]"}]}], ";"}], "]"}]], "Input",
 CellLabel->"In[3]:=",
 CellID->133925139],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{"0.100603`", ",", "Null"}], "}"}], TraditionalForm]], "Output",
 ImageSize->{105, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[3]=",
 CellID->904704881]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"res1", "===", "res2"}]], "Input",
 CellLabel->"In[4]:=",
 CellID->1580956926],

Cell[BoxData[
 FormBox["True", TraditionalForm]], "Output",
 ImageSize->{31, 14},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[4]=",
 CellID->1145286211]
}, Open  ]],

Cell[BoxData[
 RowBox[{"ClearAll", "[", 
  RowBox[{"exp", ",", "res1", ",", "res2"}], "]"}]], "Input",
 CellLabel->"In[5]:=",
 CellID->132487496]
}, Open  ]]
}, Open  ]],

Cell[" ", "FooterCell"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{725, 750},
WindowMargins->{{278, Automatic}, {Automatic, 28}},
WindowTitle->"ExpandAll2",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "SymbolColor", "LinkTrails" -> 
  GridBox[{{
      RowBox[{
        ButtonBox[
        "FeynCalc", ButtonData -> "paclet:FeynCalc/guide/FeynCalc", 
         BaseStyle -> {"Link", "DockedLinkTrail"}]}]}}, ColumnAlignments -> 
    Left], "HasOptions" -> False, "ExampleCounter" -> 1, "NeedPlatMsgIn" -> 
  None, "RootCaptions" -> "", 
  "Metadata" -> {
   "built" -> "{2020, 6, 20, 19, 4, 37.968803}", 
    "history" -> {"9.3", "", "", ""}, "context" -> "FeynCalc`", 
    "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Feyn Calc Symbol", "language" -> "en", "paclet" -> "FeynCalc", "status" -> 
    "None", "summary" -> 
    "ExpandAll2[exp] is similar to ExpandAll, but much faster on simple \
structures.", "synonyms" -> {}, "tabletags" -> {}, "title" -> "ExpandAll2", 
    "titlemodifier" -> "", "windowtitle" -> "ExpandAll2", "type" -> "Symbol", 
    "uri" -> "FeynCalc/ref/ExpandAll2"}, "SearchTextTranslated" -> ""},
CellContext->"Global`",
FrontEndVersion->"10.4 for Linux x86 (64-bit) (April 11, 2016)",
StyleDefinitions->Notebook[{
   Cell[
    StyleData[
    StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb"]]], 
   Cell[
    StyleData["Input"], CellContext -> "Global`"], 
   Cell[
    StyleData["Output"], CellContext -> "Global`"]}, Visible -> False, 
  FrontEndVersion -> "10.4 for Linux x86 (64-bit) (April 11, 2016)", 
  StyleDefinitions -> "Default.nb"]
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "PrimaryExamplesSection"->{
  Cell[3590, 105, 388, 15, 31, "PrimaryExamplesSection",
   CellTags->"PrimaryExamplesSection",
   CellID->2028008185]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"PrimaryExamplesSection", 8033, 264}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[582, 21, 2280, 53, 53, "AnchorBarGrid",
 CellID->1],
Cell[2865, 76, 287, 11, 45, "ObjectNameGrid"],
Cell[3155, 89, 410, 12, 85, "Usage",
 CellID->982511436],
Cell[CellGroupData[{
Cell[3590, 105, 388, 15, 31, "PrimaryExamplesSection",
 CellTags->"PrimaryExamplesSection",
 CellID->2028008185],
Cell[CellGroupData[{
Cell[4003, 124, 196, 6, 26, "ExampleSection",
 CellID->1783834313],
Cell[4202, 132, 76, 1, 32, "Notes",
 CellID->29146736],
Cell[4281, 135, 454, 16, 27, "Input",
 CellID->815060274],
Cell[CellGroupData[{
Cell[4760, 155, 196, 6, 27, "Input",
 CellID->1771988175],
Cell[4959, 163, 245, 8, 37, "Output",
 CellID->562912175]
}, Open  ]],
Cell[CellGroupData[{
Cell[5241, 176, 196, 6, 27, "Input",
 CellID->133925139],
Cell[5440, 184, 245, 8, 37, "Output",
 CellID->904704881]
}, Open  ]],
Cell[CellGroupData[{
Cell[5722, 197, 101, 3, 27, "Input",
 CellID->1580956926],
Cell[5826, 202, 190, 6, 35, "Output",
 CellID->1145286211]
}, Open  ]],
Cell[6031, 211, 145, 4, 27, "Input",
 CellID->132487496]
}, Open  ]]
}, Open  ]],
Cell[6203, 219, 23, 0, 41, "FooterCell"]
}
]
*)

(* End of internal cache information *)

